<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="javax.servlet.ServletException"%>
<%@page import="java.io.PrintWriter"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>==Encounter Error!==</title>
</head>
<body>
<p>
<%
		try {
			// The Servlet spec guarantees this attribute will be available
			Exception exception = (Exception) request.getAttribute("javax.servlet.error.exception");
	
			if (exception != null) {
				if (exception instanceof ServletException) {
					// It's a ServletException: we should extract the root cause
					ServletException sex = (ServletException) exception;
					Throwable rootCause = sex.getRootCause();
					if (rootCause == null) {
						rootCause = sex;
					}
					out.println("** Root cause is: " + rootCause.getMessage());
					rootCause.printStackTrace(new PrintWriter(out));
				} else {
					// It's not a ServletException, so we'll just show it
					exception.printStackTrace(new PrintWriter(out));
				}
			} else {
				out.println("No error information available");
			}
		} catch (Exception ex) {
			ex.printStackTrace(new PrintWriter(out));
		}
%>
</p>

</body>
</html>